package com.haoze.nurseapp.service.feign;

import com.haoze.common.response.Result;
import com.haoze.common.response.ResultGenerator;
import feign.Headers;
import feign.hystrix.FallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

@Service
@Headers({"Content-Type:application/json"})
//@FeignClient(name = "api-emr" ,url = "http://localhost:8107",fallback = FallbackFactory.Default.class, configuration = FeignSupportConfig.class)
@FeignClient(name = "api-emr")
//@FeignClient(name = "api-emr")
public interface AssessmentScaleService {
    @GetMapping(value = "/emr/fileindex/scoreCreate",headers = "api-version=2.1")
    @ApiOperation(value = "新增病历")
    Result scoreCreate(@RequestParam final String tplId,
                       @RequestParam final String inpatNum,
                       @RequestParam final String deptId,
                       @RequestParam(required = false) String uuid);


    @PostMapping(value="/emr/fileindex/save",headers = "api-version=2.1")
    @ApiOperation(value = "保存病历")
    Result saveFileIndex(@RequestBody final String json);


    @GetMapping(value="/emr/fileindex/dynamicCascade",headers = "api-version=2.1")
    @ApiOperation(value = "级联")
    Result dynamicCascade(@RequestParam String medicalId,//医疗术语ID
                                 @RequestParam(required = false) final String dataRelationIds,//值域id或者数据元id
                                 @RequestParam(required = false) final String numberValue);//对应数值


    @GetMapping(value = "/emr/template/getVteDetail",headers = "api-version=2.1")
    @ApiOperation(value = "获取病人评估明细表格")
    Result getVteDetail (@RequestParam final String inpatNum,@RequestParam final String catalogId,
                                @RequestParam final String strTm,@RequestParam final String endTm);


    @GetMapping(value = "/emr/fileindex/{emrFileId}",headers = "api-version=2.1")
    @ApiOperation(value = "获取病历")
    Result getFileIndex(@PathVariable final String emrFileId);

    @DeleteMapping("/emr/fileindex/{emrFileId}")
    @ApiOperation(value = "删除病历")
    public Result deleteFileIndex(@PathVariable final String emrFileId);
}
